var client = (function (c){
    var initials = false, cID;
    c.loadClient = function (clientID){
        cID = clientID;
       c.initClient();
    };
    c.initClient = function (){
        if(!initials){
            $("#btnClientBack").click( function (){
                main.updateList();
                $.mobile.changePage("#pnMainPage");
            });
            $("#btnClientEdit").click( function (){
                //addnewclient.initAddnewclient();
                addnewclient.edit(cID);
                $.mobile.changePage("#pnAddNewClient");
                //windows.showPage("pnClient","pnAddNewClient");
            });
            $("#btnContacts").click( function (){
                contacts.loadContacts(cID);
                $.mobile.changePage("#pnContacts");
                //windows.showPage("pnClient","pnContacts");
            });
            $("#btnPricesForClient").click( function (){
                pricesforclient.loadPricedForClient(cID);
                windows.showPage("pnClient","pnPriceForClient");
            });
            $("#btnProject").click( function (){
                addnewproject.initAddNewProject(cID);
                $.mobile.changePage("#pnProject");
                //windows.showPage("pnClient","pnContacts");
            });
        }
    };
    return c;
}(client || {}));
